import standard.PackageConfig;
import standard.util.Generator;

import java.io.IOException;
import java.sql.SQLException;
import java.util.Scanner;

/**
 * Create by Lingo
 */

public class FreemarkDemo {

    public static void main(String[] args) throws SQLException, ClassNotFoundException {
        System.out.println("请输入表名");
        Scanner in = new Scanner(System.in);
        String tableName = in.nextLine();
        System.out.println("请输入模块名");
        String modelName = in.nextLine();
        System.out.println("请输入targetPackage");
        String targetPackage = in.nextLine();
//        String tableName = "t_bb_agreement";
//        String modelName = "companyAgreement";
//        String targetPackage = "com.xingyun.xybb.admin";
        PackageConfig packageConfig = new PackageConfig();
        packageConfig.setModelName(modelName);
        packageConfig.setTargetPackage(targetPackage);
        Generator generator = new Generator(tableName, packageConfig);
        try {
            generator.generate();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
